﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Yipusoft.TownshipEnterprise.BLL;
using System.Collections.Generic;
using Yipusoft.TownshipEnterprise.Model;

public partial class TownshipEnterprise_BarracksView : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            Bind(0);


    }

    public void ListPageContral1_PageSizeChange(int pageSize, int PageIndex)
    {
        Bind(PageIndex);
    }

    private void Bind(int pageindex)
    {
        string DepartmentID = string.Empty;
        if (Request["Id"] != null)
        {
            Guid id = new Guid(Request["Id"].ToString());
            List<TownPicsInfo> lst = TownPics.GetList(" TownBasicInfoID='" + id + "' and TownItemsID='6'");
            if (lst != null)
            {
                this.ListPageContral1.ItemCount = TownPics.GetCount(" id='" + id + "' and TownItemsID='6'");
                DltList.DataSource = lst;
                DltList.DataBind();
            }
        }
    }

    public string GetPicUrl(object objID)
    {
        if (objID == null)
            return "/Images/none.jpg";
        else
            return objID.ToString();
    }

    public string GetPicType(Object obj)
    {
        if(obj!=null)
        return TownPicsType.GetTownPicsType(obj.ToString()).PicType;
        return " ";
    }
}
